﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MetadataBasedConfig.EntityModel;
using System.Configuration;
using System.Data.Objects.DataClasses;
using MetadataBasedConfig.Framework;
using System.Data.Objects;

namespace MetadataBasedConfig.EntityModel.Entity
{
    public static class Helper
    {
        private static string ConnectString = ConfigurationManager.ConnectionStrings["MDAEntitiesHome"].ConnectionString;

        public static readonly MDAEntities MDAEntities = new MDAEntities(ConnectString);

        public static readonly IConfigMetadataProvider ConfigMetadataProvider = new EntityConfigMetadataProvider(MDAEntities); 

        public static string GetMappingTable<T>() where T : EntityObject
        {
            return GetMappingTable(typeof(T));
        }

        // TODO
        public static string GetMappingTable(Type entityType) 
        { 
            return entityType.Name;
        }
    }
}
